import request from '@/utils/request'

// 员工开始
export function getEmployees(query){
  return request({
    url: '/finance/employee/',
    method: 'GET',
    params: query
  })
}

export function addEmployee(employeeInfo){
  return request({
    url: '/finance/employee/',
    method: 'POST',
    data: employeeInfo
  })
}

export function updateEmployee(employeeInfo){
  return request({
    url: `/finance/employee/${employeeInfo.id}/`,
    method: 'PATCH',
    data: employeeInfo
  })
}

export function delEmployee(employee_id){
  return request({
    url: `/finance/employee/${employee_id}/`,
    method: 'DELETE',
  })
}

export function getEmployeeList(){
  return request({
    url: '/finance/employee_list/',
    method: 'GET'
  })
}
// 员工结束

// 利润分配比例开始
export function getRuleList(){
  return request({
    url: '/finance/rule/',
    method: 'GET'
  })
}

export function addRule(ruleInfo){
  return request({
    url: '/finance/rule/',
    method: 'POST',
    data: ruleInfo
  })
}

export function updateRule(ruleInfo){
  return request({
    url: `/finance/rule/${ruleInfo.id}/`,
    method: 'PATCH',
    data: ruleInfo
  })
}

export function delRule(rule_id){
  return request({
    url: `/finance/rule/${rule_id}/`,
    method: 'DELETE',
  })
}

// 利润分配比例结束